package com.lysj.website.auth.service;

import com.lysj.website.auth.domain.RolePermission;
import com.lysj.website.auth.repository.RolePermissionRepository;
import com.lysj.website.common.spring.base.BaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @author zk
 * @description 角色权限关联表服务层
 * @create 2018-07-25 15:51:38
 **/
@Slf4j
@Service
@Transactional
public class RolePermissionService implements BaseService<RolePermission> {

    @Resource
    private RolePermissionRepository rolePermissionRepository;

    @Override
    public RolePermissionRepository getRepository() {
        return rolePermissionRepository;
    }


    public void deleteByRoleId(String id){
        rolePermissionRepository.deleteByRoleId(id);
    }

    public void deleteByPermissionId(String id){
        rolePermissionRepository.deleteByPermissionId(id);
    }
}